//
//  NBCURLNavgation.h
//  NBCURLRouterDemo
//
//  Created by naruto on 16/8/17.
//  Copyright © 2016年 naruto. All rights reserved.
//  控制器 导航控制器管理

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class NBCURLPageModel;
@interface NBCURLNavgation : NSObject

#pragma mark - 获取当前vc 、当前 navgation controller
/**
 *  返回当前控制器
 */
- (UIViewController*)currentViewController;

/**
 *  返回当前的导航控制器
 */
- (UINavigationController*)currentNavigationViewController;


#pragma mark - push vc

/**
 push方式推入一个vc

 @param viewController 需要推入的vc
 @param animated 动画参数
 @param replace 是否需要替换
 */
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated replace:(BOOL)replace;


#pragma mark - present vc

/**
 present 方式推入一个vc

 @param viewController 需要推入的vc
 @param animated 动画参数
 @param completion 完成回调
 */
- (void)presentViewController:(UIViewController *)viewController animated: (BOOL)animated completion:(void (^ __nullable)(void))completion;

#pragma mark - pop vc

/**
 pop方式弹出一个vc

 @param animated 动画参数
 */
- (void)popViewControllerAnimated:(BOOL)animated;

/**
 pop方式弹出到根vc，显示根vc

 @param animated 动画参数
 */
- (void)popToRootViewControllerAnimated:(BOOL)animated;

#pragma mark - dismiss vc

/**
 dismiss方式弹出 到当前根vc

 @param animated 动画参数
 @param completion 完成回调action
 */
- (void)dismissToRootViewControllerAnimated: (BOOL)animated completion: (void (^ __nullable)(void))completion;

/**
 dismiss方式弹出 若干个vc

 @param times 弹出几个vc
 @param animated 动画参数
 @param completion 完成回调action
 */
- (void)dismissViewControllerWithTimes:(NSUInteger)times animated: (BOOL)animated completion: (void (^ __nullable)(void))completion;


#pragma mark - vc help
- (UIViewController *)setupFromString:(NSString *)urlString fromConfig:(NSMutableArray<NBCURLPageModel *> *)routeConfig;

- (UIViewController *)setupFromString:(NSString *)urlString withQuery:(NSDictionary *)query fromConfig:(NSMutableArray<NBCURLPageModel *> *)routeConfig;

NS_ASSUME_NONNULL_END

@end
